package gui.customizer.panes.netfilter;

import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import net.miginfocom.swing.MigLayout;
import javax.swing.JCheckBox;
import javax.swing.JButton;

public class SaveAndSend extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = -9126849700714762967L;
	private JButton btnSend;
	private JCheckBox chckbxAddFlushRules;

	public SaveAndSend() {
		this.setBorder(BorderFactory.createTitledBorder("Save and send"));
		setLayout(new MigLayout("", "[]20[]", "[]"));
		
		chckbxAddFlushRules = new JCheckBox("Add flush rules at the beginning");
		chckbxAddFlushRules.setSelected(true);
		add(chckbxAddFlushRules, "cell 0 0");
		
		btnSend = new JButton("Send to remote server");
		add(btnSend, "cell 1 0");
	}
	
	public void addListenerToSendButton(ActionListener l) {
		btnSend.addActionListener(l);
	}
	
	public boolean ShouldAddFlushRules() {
		return chckbxAddFlushRules.isSelected();
	}
}
